package com.stn.zjx.givingtreasure.broadcastreceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;

import com.stn.zjx.givingtreasure.MainActivity;
import com.stn.zjx.givingtreasure.service.AppUpdateService;

public class NotificationBroadcastReceiver extends BroadcastReceiver {
      public static final int FLAG_DOWNLOAD_ERROR=150;
    @Override
    public void onReceive(Context context, Intent intent) {
                  String  data=intent.getStringExtra("data");
            switch (intent.getIntExtra("flag",0)){
                case FLAG_DOWNLOAD_ERROR:
                    Intent start=new Intent(context,AppUpdateService.class);
                    start.putExtra("download_url",data);
                    context.startService(start);
                    break;
            }
    }
}
